package com.yyg.boot.web;

import com.yyg.boot.domain.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Description 内容协商管理
 * @Author 一一哥Sun
 * @Date Created in 2020/3/21
 */
@Slf4j
@Controller
public class NegotiationController {

    @ResponseBody
    @GetMapping(value = "/show")
    public User showUser() {
        User user = new User();
        user.setName("一一哥");
        user.setSex("男");
        user.setDesc("一一哥讲解内容协商机制了...");
        return user;
    }

    @ResponseBody
    @GetMapping(value = "/show/{id}")
    public User showUserName(@PathVariable(value = "id", required = false) String id) {
        log.warn("id={}", id);
        User user = new User();
        user.setName("一一哥");
        user.setSex("男");
        user.setDesc("一一哥讲解内容协商机制了...");
        return user;
    }

    @ResponseBody
    @GetMapping(value = "/showMsg",produces = MediaType.APPLICATION_JSON_VALUE)
    public User showMsg() {
        User user = new User();
        user.setName("一一哥Sun");
        user.setSex("男");
        user.setDesc("一一哥Sun讲解内容协商机制了...,关注我的头条号:一一哥Sun,可以得到更多内容哦!");
        return user;
    }

}
